<template>
    <div>
        <van-tabbar v-model="active" active-color="#ee0a24" inactive-color="#000" :route="true">

            <van-tabbar-item icon="home-o" to="/home">首页</van-tabbar-item>
            <van-tabbar-item icon="search" to="/cart">
                <span>购物车</span>
                <template #icon="props">
                    <van-icon name="cart-o" />
                </template>
            </van-tabbar-item>
            <van-tabbar-item icon="friends-o" :to="where">{{name}}</van-tabbar-item>
        </van-tabbar>
    </div>
</template>

<script setup lang="ts">
import { ref, reactive, computed, watch, defineProps, defineEmits } from 'vue'

let active = ref('')

let where = computed(()=>{
    return  localStorage.getItem('token')?'/mine':'/login'
})
let name = computed(()=>{
    return localStorage.getItem('token')?'我的':'登录'
})
</script>
<style scoped>

</style>